package com.ruoyi.system.enums;

import com.ruoyi.common.utils.StringUtils;

public enum MediaTypeEnum {
    XINWENDALEI("01", "新闻大类"),
    NEWS("0101", "新闻"),
    PINGMEI("0105", "平媒"),
    App("0109", "APP"),
    LUNTAN("02", "论坛"),
    TIEBA("0201", "百度贴吧"),
    BOKE("03", "博客"),
    WEIBO("04", "微博"),
    XINLANGWEIBO("0401", "新浪微博"),
    XINLANGCHANGWEIBO("0408", "新浪长微博"),
    WEIXIN("06", "微信"),
    SHIPIN("07", "视频"),
    XAIOSHIPIN("11", "小视频"),
    DOUYIN("1101", "抖音"),
    KUAISHOU("1102", "快手"),
    SEARCH("99", "搜索");

    public String getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(String value){
        for (MediaTypeEnum mediaTypeEnum : MediaTypeEnum.values()) {
            if (StringUtils.equals(mediaTypeEnum.getValue(), value)) {
                return mediaTypeEnum.getName();
            }
        }
        return "其他";
    }

    public final String value;
    public final String name;

    MediaTypeEnum(String value, String name) {
        this.value = value;
        this.name = name;
    }
}
